package com.piggy.msg.server;

import com.piggy.common.satoken.annotation.EnableCustomConfig;
import com.piggy.common.satoken.annotation.EnableCustomFeignClients;
import com.piggy.common.swagger.annotation.EnableCustomSwagger2;
import com.piggy.msg.server.service.EmailConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;


/**
 * @author liuyadu
 */
@EnableCustomConfig
@EnableCustomSwagger2
@EnableCustomFeignClients
@RefreshScope
@SpringBootApplication
public class PIGYMsgApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(PIGYMsgApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  消息中心启动成功   ლ(´ڡ`ლ)ﾞ  \n" );
    }

    @Autowired
    private EmailConfigService emailConfigService;

    @Override
    public void run(String... strings) throws Exception {
        emailConfigService.loadCacheConfig();
    }
}
